package com.smartleanx.module.hrm.intergration;

import com.smartleanx.module.system.api.customfield.CustomFieldApi;
import com.smartleanx.module.system.api.customfield.dto.CustomFieldArchiveDTO;
import com.smartleanx.module.system.api.customfield.dto.CustomFieldReqDTO;
import com.smartleanx.module.system.api.customfield.dto.CustomFieldRespDTO;
import com.smartleanx.module.system.api.customfield.dto.CustomFieldSaveDTO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 自定义字段相关
 */
@Component
public class CustomFieldServiceProvider {

    @Resource
    private CustomFieldApi customFieldApi;

    /**
     * 查询自定义数据
     */
   public List<CustomFieldRespDTO> getFieldList(CustomFieldReqDTO reqDTO){
       return customFieldApi.getFieldList(reqDTO).getCheckedData();
   }


    public Boolean archiveField(Integer bizType, Long version){
       return customFieldApi.archiveField(CustomFieldArchiveDTO.builder().bizType(bizType).version(version).build()).getCheckedData();
    }

    public Boolean crudFiled(CustomFieldSaveDTO saveDTO){
       return customFieldApi.crudFiled(saveDTO).getCheckedData();
    }
}
